package com.mlog.njyjy.ndop.msg.common.domain;

import com.jfinal.plugin.activerecord.Model;
import com.mlog.njyjy.ndop.msg.common.domain.core.Timeable;
import com.mlog.njyjy.ndop.msg.common.support.Constants;
import com.mlog.njyjy.ndop.share.sql.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * .
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/7/10
 */
@Data
@Accessors(chain = true)
@Table(prefix = Constants.TBL_MSG_PREFIX,
        uniques = {@TableUnique(columns = {"name", "dictId"})},
        comment = "字典项表")
public class DictItem extends Model<DictItem> implements Timeable {

    @Id
    private Long id;

    @Column(nullable = false)
    private String name;

    @Column(length = 255)
    private String title;

    @Column(nullable = false)
    private Long dictId;

    @Column(updatable = false)
    private LocalDateTime createAt;

    private LocalDateTime updateAt;

    /**
     * TESTME
     */
    @Join(joinedBy = "dictId", mappedBy = "id")
    private Dict dict;

}
